import sqlite3

    #def __init__ (self,master=None):
        
def con(iu,i):
    conn = sqlite3.connect('/home/tos/test.db')
    #conn.execute("insert into user values(?,?,?)",(2,'root','123456'))
    #conn.commit()
    cursor = conn.execute("select *  from user where name = ? and password =?",iu)
    for row in cursor:
        print "ID = ",row[0]
        print row[1]
        i[0] = 1
	#conn.close()

def ins(noid,temp,parent):
	conn = sqlite3.connect('/home/tos/test.db')
	conn.execute("insert into node (nodeid,temp,parent) values(?,?,?)",(noid,temp,parent))
	conn.commit()
            
if __name__ == '__main__':
    ths = ('root','123456')
    i=[0]
    con(ths,i)
    print i[0]
